<?php

namespace catchAdmin\hunqing\tables;

use catchAdmin\hunqing\tables\forms\Factory;
use catcher\CatchTable;
use catcher\library\table\Actions;
use catcher\library\table\HeaderItem;
use catcher\library\table\Search;

class staffs extends Catchtable
{
    public function table()
    {
        return $this->getTable('staffs')
            ->header([
                HeaderItem::label('')->selection(),
                HeaderItem::label('员工姓名')->prop('name'),
                HeaderItem::label('员工电话')->prop('tel'),
                HeaderItem::label('密码')->prop('password'),
                HeaderItem::label('备注')->prop('bak'),

                HeaderItem::label('操作')->width(250)->actions([
                    Actions::update(),
                    Actions::delete(),


                ])
            ])
            ->withSearch([
                Search::label('会员名')->text('name', '姓名'),


            ])
            ->withApiRoute('staffs')
            ->withActions([
                Actions::create(),

            ])


            ->selectionChange()
            ->render();

    }


    public function form()
    {
        return Factory::create('staffs');

    }

}